﻿using CPPEI.Coolzon.Core.Data;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CPPEI.Coolzon.Core.Repositories
{
    public interface IUserRepository
    {
        /// <summary>
        /// 获取用户列表
        /// </summary>
        /// <param name="context"></param>
        /// <param name="start"></param>
        /// <param name="limit"></param>
        /// <returns></returns>
        PagedList<User> GetUserList(DbContext context, int start, int limit);

        /// <summary>
        /// 创建用户
        /// </summary>
        /// <param name="context"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        bool CreateUser(DbContext context, User user);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="context"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        bool RemoveUser(DbContext context, User user);

        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="context"></param>
        /// <param name="user"></param>
        /// <returns></returns>
        bool UpdateUser(DbContext context, User user);

        /// <summary>
        /// 通过userId获取User对象
        /// </summary>
        /// <param name="context"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        User GetUser(DbContext context, Guid userId);

        /// <summary>
        /// 通过Account用户名获取User对象
        /// </summary>
        /// <param name="context"></param>
        /// <param name="Account"></param>
        /// <returns></returns>
        User GetUser(DbContext context, string Account);
    }
}
